.PHONY : all clean check install

# environment variables
  CC :=gcc -std=gnu99
  CFLAGS :=-Wall -g   
  LDFLAGS := 

# custom variables
  OutputDir := $(PWD)/output
  export
  
all: check mylib Makefile 
	make -C src/
	
# check 
check:
	install -d $(OutputDir)


mylib: 
	make -C lib/

clean:
	make -C lib/ clean
	make -C src/ clean

test:
	./output/myprog 12

install:
	install -d ~/.bin
	install  output/myprog_* ~/.bin

uninstall:
	-rm ~/.bin/myprog_*
